#include <stdio.h>

int main(int argc, char* argv[])
{
    unsigned int mask01 = 0x08080808;
    unsigned int mask80 = 0x80808080;

    unsigned int intArray[] = {
        0x01020300,
        0x04050607,
        0x0809a0b0,
        0x0cd00fe0,
        0xff000120,
        0x00010203,
        0x00000000,
        0xffffffff,
        0
    };
    int i = 0;

    for(i = 0; i < sizeof(intArray)/sizeof(unsigned int); i++)
    {
        printf("x[%d] = 0x%X\n", i, intArray[i]);
        printf("x[%d] - 0x08 = 0x%X\n", i, (intArray[i] - mask01));
        printf("~x[%d] = 0x%X\n", i, (~intArray[i]));
        printf("(x[%d] - 0x08) & ~x[%d] = 0x%X\n", i, i, 
            (intArray[i] - mask01) & ~intArray[i]);
        printf("Ans = %X\n", (intArray[i] - mask01) & ~intArray[i] & mask80);
        printf("Ans 2 = %X\n", (intArray[i] - mask01) & mask80);
    }
    return 0;
}

